#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
if [ "${1:-}" = "--selftest" ]; then
  cd "$root"
  exec octave --no-window-system --quiet tests/run_tests.m
fi
cd "$root"
exec octave --no-window-system --quiet main.m "$@"
